import request from "@/utils/request";
import { parseStrEmpty } from "@/utils/ruoyi";


// projectService
export const projectService = {


    list(query) {
        return request({
            url: "/api/project/list",
            method: "get",
            params: query,
        });
    },

    postSave(data) {
        return request({
            url: `/api/project/save-or-update`,
            method: "post",
            data,
        });
    },
    postEmp(data) {
        return request({
            url: `/api/project/save-emp/${data.id}`,
            method: "post",
            data: data.empIds,
        });
    },

};


// positionService
export const positionService = {


    list(query) {
        return request({
            url: "/api/position/list",
            method: "get",
            params: query,
        });
    },

    postSave(data) {
        return request({
            url: `/api/position/save-or-update`,
            method: "post",
            data,
        });
    },

};


// departmentService
export const departmentService = {


    list(query) {
        return request({
            url: "/api/department/list",
            method: "get",
            params: query,
        });
    },

    postSave(data) {
        return request({
            url: `/api/department/save-or-update`,
            method: "post",
            data,
        });
    },

};

// employeeService
export const employeeService = {


    list(query) {
        return request({
            url: "/api/employee/list",
            method: "get",
            params: query,
        });
    },

    postSave(data) {
        return request({
            url: `/api/employee/save-or-update`,
            method: "post",
            data,
        });
    },
    postDept(data) {
        return request({
            url: `/api/employee/save-dept/${data.empId}/${data.deptId}`,
            method: "post",
            data,
        });
    },
    postPosition(data) {
        return request({
            url: `/api/employee/save-position/${data.empId}/${data.posId}`,
            method: "post",
            data,
        });
    },

};
